package phoenix.web.locators.base.features;

import org.openqa.selenium.By;

/**
 * Created by AlexGolovko on 15.09.2014.
 */
public abstract class MessengerLocatorsBase
{
	public By blockUserListMessenger = By.xpath("//ul[@id='cTalksRecipientCollectionWrap']/li");
	public By blockItemUser = By.xpath("//ul[@id='cTalksRecipientCollectionWrap']/li");

	// Messenger related
	public By blockLoginName = By.xpath("//a/div[@class='user-describe']/span[@class='screenname']");
	public By blockCounter = By.xpath("//a/span[@class='counter']");
	public By blockOnline = By.xpath("//a/div[@class='user-describe']/span[@class='status online']");
	public By blockUserID = By.xpath("//a[@data-userid]");

	public By blockMessageInputField = By.xpath("//div[@id='cTalksInputMessage']");
	public By blockInputMessage = By.id("cTalksInputMessage");
	public By blockLoader = By.xpath("//div[@class='messages-wrapper loading']");
	public By blockRead = By.xpath("//span[@title='Read']");
	public By blockUnread = By.xpath("//span[@title='Unread']");
	public By blockMessageText = By.id("cTalksMessageList"); // Text in messenger window
	public By blockMessageOut = By.xpath(".//div[@class='message message-out']");
	public By blockMessageIn = By.xpath(".//div[@class='message message-in']");

	public By blockMessageItemTimeLast = By.xpath("//*[@class='msg out'][last()]//span[@class='time']"); // Timestamp

	// Buttons
	public By btnMessageOpen = By.cssSelector("a.btn-activity.btn-chat");

	public By btnClose = By.xpath("//a[@data-state='close']");
	public By btnMaximize = By.xpath("//a[@title='Maximize']");
	public By btnMinimize = By.xpath("//a[@title='Minimize']");
	public By btnPopOut = By.xpath("//a[@title='Pop-out']");
	public By btnPopIn = By.xpath("//a[@title='Pop-in']");
	public By bntFAQ = By.xpath("//div[@class='b-info-types']");
	public By btnOptions = By.xpath("//span[contains(.,'Options')]");
	public By btnDelete = By.xpath("//a[@title='Delete conversations']");
	public By btnSmiles = By.xpath("//div[@id='cTalksSmiles']");
	public By btnSubmit = By.xpath("//button[@class='btn-talks btn-send']");
	public By btnVideo = By.xpath("//span[@class='btn-video']");

	// Element
	public By elTitleIcon = By.xpath("//h2[@class='title icon-msg']");
	public By elHistory = By.xpath("//div[@class='messenger-history']");
	public By elUsersList = By.id("cTalksRecipientCollection");

	public By txtTitle = By.xpath("//div[@id='cTalksHeader']//*[@class='name']");
	public By elCounter = By.xpath("//div[@id='cTalksHeader']//*[@class='counter']");

	public By btnUpgradeMessage = By.xpath("//a[@data-feature='upgradeRead']");
	public By linkUpgradeFreeCommunication = By.xpath("//*[@class='message-microfeature']//*[@class='checkbox-info']");
	public By linkUpgradeSpecialDelivery = By.xpath(".//*[@class='message-first-read']//*[@class='checkbox-info']");

	public By btnUser(String id)
	{
		return By.xpath("//ul[@id='cTalksRecipientCollectionWrap']/li/a[@data-userid='" + id + "']");
	}
}
